﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Doan_ver1
{
    public partial class WebForm8 : System.Web.UI.Page
    {
        public string connection()
        {
            return Provider.connectionString();
        }
      

     
        public void load()
        {
            SQLNganHangDataContext data = new SQLNganHangDataContext(connection());
            TaiKhoan tk = data.TaiKhoans.Where(c => c.TenDangNhap == Session["khachhang"] as string).FirstOrDefault();
            var lstLichSuGD = from b in data.ChiTietGD_NHs
                              where b.MaTaiKhoan == tk.MaTaiKhoan
                              select new
                              {

                                  SoTien  = b.SoTien.ToString().Replace(".000000", string.Empty),
                                  NgayGD = b.Ngay,
                                  MaLoaiGiaoDich = b.MaLoaiGD_NH.Replace("1", "Gửi").Replace("2", "Nhận")
                              };
            GridView1.DataSource = lstLichSuGD;
            GridView1.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["khachhang"] == null)
                Response.Redirect("DangNhap.aspx");
            load();
        }

        protected void GridView1_PageIndexChanged(object sender, EventArgs e)
        {

        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {

        }

      

        
    }
}